# Library
library(texreg)
library(lmtest)
library(interplot)
library(ggpubr)
library(sandwich)
library(SimDesign)
library(plyr)

# Read in the data
load("Data_experiments.RData")

# Create objects without leaners
dat_lab_sub_nolean <- subset(dat_lab, leaners_lab==0|is.na(leaners_lab))
dat_con_sub_nolean <- subset(dat_con, leaners_con==0|is.na(leaners_con))

###########################
# OA2
###########################

### Labour

# mr vs. control
modlab_mrcontrol <- glm(mrcontrol ~ female + age_dec + educ_fourlevels + income + mc_avg + mftcare, data=dat_lab,family="binomial")
# mr vs. pr
modlab_mrpr <- glm(mrpr ~ female + age_dec + educ_fourlevels + income + mc_avg + mftcare, data=dat_lab,family="binomial")

### Conservative

# mr vs. control
modcon_mrcontrol <- glm(mrcontrol ~ female + age_dec + educ_fourlevels + income + mc_avg + mftfair, data=dat_con,family="binomial")
# mr vs. pr
modcon_mrpr <- glm(mrpr ~ female + age_dec + educ_fourlevels + income + mc_avg + mftfair, data=dat_con,family="binomial")

texreg(list(modlab_mrcontrol, modlab_mrpr, modcon_mrcontrol, modcon_mrpr),stars=0.05)

# Likelihood ratio test
lrtest(glm(mrcontrol ~ female + age_dec + educ_fourlevels + income + mc_avg + mftcare, 
           data=dat_lab[complete.cases(dat_lab[,c("mrcontrol","female","age_dec","educ_fourlevels","income","mc_avg","mftcare")]),c("mrcontrol","female","age_dec","educ_fourlevels","income","mc_avg","mftcare")],
           family="binomial"))
lrtest(glm(mrpr ~ female + age_dec + educ_fourlevels + income + mc_avg + mftcare, 
           data=dat_lab[complete.cases(dat_lab[,c("mrpr","female","age_dec","educ_fourlevels","income","mc_avg","mftcare")]),c("mrpr","female","age_dec","educ_fourlevels","income","mc_avg","mftcare")],
           family="binomial"))
lrtest(glm(mrcontrol ~ female + age_dec + educ_fourlevels + income + mc_avg + mftfair, 
           data=dat_con[complete.cases(dat_con[,c("mrcontrol","female","age_dec","educ_fourlevels","income","mc_avg","mftfair")]),c("mrcontrol","female","age_dec","educ_fourlevels","income","mc_avg","mftfair")],
           family="binomial"))
lrtest(glm(mrpr ~ female + age_dec + educ_fourlevels + income + mc_avg + mftfair, 
           data=dat_con[complete.cases(dat_con[,c("mrpr","female","age_dec","educ_fourlevels","income","mc_avg","mftfair")]),c("mrpr","female","age_dec","educ_fourlevels","income","mc_avg","mftfair")],
           family="binomial"))

###########################
# OA3
###########################

## H1

# Labour: MR vs. Control
labLikeMod_prepost <- lm(likeL_post ~ mrcontrol + likeL_pre, data=dat_lab)
labLikeMod_diff <- lm(likeLdiff ~ mrcontrol, data=dat_lab)

# Labour: MR vs PR
labLikeModpr_prepost <- lm(likeL_post ~ mrpr + likeL_pre, dat_lab) 
labLikeModpr_diff <- lm(likeLdiff ~ mrpr, dat_lab)

# Conservative: MR vs. Control
conLikeMod_prepost <- lm(likeC_post ~ mrcontrol + likeC_pre, data=dat_con)
conLikeMod_diff <- lm(likeCdiff ~ mrcontrol, data=dat_con)

# Conservative: MR vs PR
conLikeModpr_prepost <- lm(likeC_post ~ mrpr + likeC_pre, dat_con)
conLikeModpr_diff <- lm(likeCdiff ~ mrpr, dat_con)

texreg(list(labLikeMod_prepost,labLikeMod_diff,labLikeModpr_prepost,labLikeModpr_diff),stars=c(0.001,0.01,0.05,0.1),symbol="\\dagger")
texreg(list(conLikeMod_prepost,conLikeMod_diff,conLikeModpr_prepost,conLikeModpr_diff),stars=c(0.001,0.01,0.05,0.1),symbol="\\dagger")

## H2

# Lab

# Labour: control vs. mr
h2labLike_prepost <- lm(likeL_post ~ mrcontrol * mftcare + likeL_pre, data=dat_lab)
h2labLike_diff <- lm(likeLdiff ~ mrcontrol * mftcare, data=dat_lab)

# Labour: pr vs. mr
h2labLikepr_prepost <- lm(likeL_post ~ mrpr * mftcare + likeL_pre, data=dat_lab)
h2labLikepr_diff <- lm(likeLdiff ~ mrpr * mftcare, data=dat_lab)

# Conservative: control vs. mr
h2conLike_prepost <- lm(likeC_post ~ mrcontrol * mftfair + likeC_pre, data=dat_con)
h2conLike_diff <- lm(likeCdiff ~ mrcontrol * mftfair, data=dat_con)

# Conservative: pr vs. mr
h2conLikepr_prepost <- lm(likeC_post ~ mrpr * mftfair + likeC_pre, data=dat_con)
h2conLikepr_diff <- lm(likeCdiff ~ mrpr * mftfair, data=dat_con)

texreg(list(h2labLike_prepost,h2labLike_diff,h2labLikepr_prepost,h2labLikepr_diff),stars=0.05)
texreg(list(h2conLike_prepost,h2conLike_diff,h2conLikepr_prepost,h2conLikepr_diff),stars=0.05)

## H3

# Labour
h3labLike_diff <- lm(likeLdiff ~ mrcontrol * dislikeL_pre, data=dat_lab)
h3labLikepr_diff <- lm(likeLdiff ~ mrpr * dislikeL_pre, data=dat_lab)

# Conservative
h3conLike_diff <- lm(likeCdiff ~ mrcontrol * dislikeC_pre, data=dat_con)
h3conLikepr_diff <- lm(likeCdiff ~ mrpr * dislikeC_pre, data=dat_con)

texreg(list(h3labLike_diff,h3labLikepr_diff),stars=0.05)
texreg(list(h3conLike_diff,h3conLikepr_diff),stars=0.05)

######################
### Fig OA4.1
#######################

h3labLike_diff <- lm(likeLdiff ~ mrcontrol * dislikeL_pre, data=subset(dat_lab, likeL_pre!=0))
h3labLikepr_diff <- lm(likeLdiff ~ mrpr * dislikeL_pre, data=subset(dat_lab, likeL_pre!=0))
h3conLike_diff <- lm(likeCdiff ~ mrcontrol * dislikeC_pre, data=subset(dat_con, likeC_pre!=0))
h3conLikepr_diff <- lm(likeCdiff ~ mrpr * dislikeC_pre, data=subset(dat_con, likeC_pre!=0))

labMod_diff <- interplot(h3labLike_diff,"mrcontrol","dislikeL_pre",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Labour Party") +
  ggtitle("Moral vs. control: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=16),
        axis.text=element_text(size=14),
        plot.title=element_text(size=16))

conMod_diff <- interplot(h3conLike_diff,"mrcontrol","dislikeC_pre",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Conservative Party") +
  ggtitle("Moral vs. control: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=16),
        axis.text=element_text(size=14),
        plot.title=element_text(size=16))

labModPr_diff <- interplot(h3labLikepr_diff,"mrpr","dislikeL_pre",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Labour Party") +
  ggtitle("Moral vs. pragmatic: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=16),
        axis.text=element_text(size=14),
        plot.title=element_text(size=16))

conModPr_diff <- interplot(h3conLikepr_diff,"mrpr","dislikeC_pre",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Conservative Party") +
  ggtitle("Moral vs. pragmatic: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=16),
        axis.text=element_text(size=14),
        plot.title=element_text(size=16))

pdf(file="plot_h3lab_movable.pdf",width=10,height=6)
annotate_figure(ggarrange(labMod_diff,labModPr_diff,ncol=2,nrow=1),
                top=text_grob("Labour Party Experiment\n",size=16,face="bold"),
                left=text_grob("Effect of moral rhetoric",size=16,rot=90))
dev.off()

pdf(file="plot_h3con_movable.pdf",width=10,height=6)
annotate_figure(ggarrange(conMod_diff,conModPr_diff,ncol=2,nrow=1),
                top=text_grob("Conservative Party Experiment\n",size=16,face="bold"),
                left=text_grob("Effect of moral rhetoric",size=16,rot=90))
dev.off()

######################
### Figures OA4.2-4.4
#######################

# Create variables indicating both pragmatic and control conditions as one control
dat_lab$mr <- ifelse(dat_lab$mrcontrol==1,1,0)
dat_lab$mr[is.na(dat_lab$mr)] <- 0

dat_con$mr <- ifelse(dat_con$mrcontrol==1,1,0)
dat_con$mr[is.na(dat_con$mr)] <- 0

## H1

h1lab_prepost1 <- lm(likeL_post ~ mr + likeL_pre, data=dat_lab)
h1lab_prepost2 <- lm(likeLdiff ~ mr, data=dat_lab)

h1con_prepost1 <- lm(likeC_post ~ mr + likeC_pre, data=dat_con)
h1con_prepost2 <- lm(likeCdiff ~ mr, data=dat_con)

labLikeMod_prepost_vcov <- vcovHC(h1lab_prepost1, type="HC1") 
labLikeMod_prepost_betas <- rmvnorm(n=100000,mean=h1lab_prepost1$coefficients,sigma=labLikeMod_prepost_vcov)
labLikeMod_prepost_betas <- labLikeMod_prepost_betas[,c("mr")]
labLikeMod_prepost_data <- data.frame(dim="Pre-post 1",mr=1)
labLikeMod_prepost_data$lower95 <- labLikeMod_prepost_data$upper95 <- labLikeMod_prepost_data$lower90 <- labLikeMod_prepost_data$upper90 <- labLikeMod_prepost_data$est <- NA
for(i in 1:nrow(labLikeMod_prepost_data)){
  labLikeMod_prepost_dist <- labLikeMod_prepost_data[i,"mr"] * labLikeMod_prepost_betas
  labLikeMod_prepost_data[i,"lower95"] <- quantile(labLikeMod_prepost_dist,0.025)
  labLikeMod_prepost_data[i,"lower90"] <- quantile(labLikeMod_prepost_dist,0.05)
  labLikeMod_prepost_data[i,"est"] <- quantile(labLikeMod_prepost_dist,0.5)
  labLikeMod_prepost_data[i,"upper90"] <- quantile(labLikeMod_prepost_dist,0.95)
  labLikeMod_prepost_data[i,"upper95"] <- quantile(labLikeMod_prepost_dist,0.975)
}

labLikeMod_diff_vcov <- vcovHC(h1lab_prepost2, type="HC1")
labLikeMod_diff_betas <- rmvnorm(n=100000,mean=h1lab_prepost2$coefficients,sigma=labLikeMod_diff_vcov)
labLikeMod_diff_betas <- labLikeMod_diff_betas[,c("mr")]
labLikeMod_diff_data <- data.frame(dim="Pre-post 2",mr=1)
labLikeMod_diff_data$lower95 <- labLikeMod_diff_data$upper95 <- labLikeMod_diff_data$lower90 <- labLikeMod_diff_data$upper90 <- labLikeMod_diff_data$est <- NA
for(i in 1:nrow(labLikeMod_diff_data)){
  labLikeMod_diff_dist <- labLikeMod_diff_data[i,"mr"] * labLikeMod_diff_betas
  labLikeMod_diff_data[i,"lower95"] <- quantile(labLikeMod_diff_dist,0.025)
  labLikeMod_diff_data[i,"lower90"] <- quantile(labLikeMod_diff_dist,0.05)
  labLikeMod_diff_data[i,"est"] <- quantile(labLikeMod_diff_dist,0.5)
  labLikeMod_diff_data[i,"upper90"] <- quantile(labLikeMod_diff_dist,0.95)
  labLikeMod_diff_data[i,"upper95"] <- quantile(labLikeMod_diff_dist,0.975)
}

conLikeMod_prepost_vcov <- vcovHC(h1con_prepost1, type="HC1")
conLikeMod_prepost_betas <- rmvnorm(n=100000,mean=h1con_prepost1$coefficients,sigma=conLikeMod_prepost_vcov)
conLikeMod_prepost_betas <- conLikeMod_prepost_betas[,c("mr")]
conLikeMod_prepost_data <- data.frame(dim="Pre-post 1",mr=1)
conLikeMod_prepost_data$lower95 <- conLikeMod_prepost_data$upper95 <- conLikeMod_prepost_data$lower90 <- conLikeMod_prepost_data$upper90 <- conLikeMod_prepost_data$est <- NA
for(i in 1:nrow(conLikeMod_prepost_data)){
  conLikeMod_prepost_dist <- conLikeMod_prepost_data[i,"mr"] * conLikeMod_prepost_betas
  conLikeMod_prepost_data[i,"lower95"] <- quantile(conLikeMod_prepost_dist,0.025)
  conLikeMod_prepost_data[i,"lower90"] <- quantile(conLikeMod_prepost_dist,0.05)
  conLikeMod_prepost_data[i,"est"] <- quantile(conLikeMod_prepost_dist,0.5)
  conLikeMod_prepost_data[i,"upper90"] <- quantile(conLikeMod_prepost_dist,0.95)
  conLikeMod_prepost_data[i,"upper95"] <- quantile(conLikeMod_prepost_dist,0.975)
}

conLikeMod_diff_vcov <- vcovHC(h1con_prepost2, type="HC1")
conLikeMod_diff_betas <- rmvnorm(n=100000,mean=h1con_prepost2$coefficients,sigma=conLikeMod_diff_vcov)
conLikeMod_diff_betas <- conLikeMod_diff_betas[,c("mr")]
conLikeMod_diff_data <- data.frame(dim="Pre-post 2",mr=1)
conLikeMod_diff_data$lower95 <- conLikeMod_diff_data$upper95 <- conLikeMod_diff_data$lower90 <- conLikeMod_diff_data$upper90 <- conLikeMod_diff_data$est <- NA
for(i in 1:nrow(conLikeMod_diff_data)){
  conLikeMod_diff_dist <- conLikeMod_diff_data[i,"mr"] * conLikeMod_diff_betas
  conLikeMod_diff_data[i,"lower95"] <- quantile(conLikeMod_diff_dist,0.025)
  conLikeMod_diff_data[i,"lower90"] <- quantile(conLikeMod_diff_dist,0.05)
  conLikeMod_diff_data[i,"est"] <- quantile(conLikeMod_diff_dist,0.5)
  conLikeMod_diff_data[i,"upper90"] <- quantile(conLikeMod_diff_dist,0.95)
  conLikeMod_diff_data[i,"upper95"] <- quantile(conLikeMod_diff_dist,0.975)
}

lab_cont <- rbind(labLikeMod_prepost_data,labLikeMod_diff_data)
con_cont <- rbind(conLikeMod_prepost_data,conLikeMod_diff_data)

pdf("plot_h1_onecontrol.pdf")
plot(NA,xlim = c(0.5,2.5),ylim = c(-0.4, 0.8), ylab = "Effect of moral rhetoric", xlab = "", xaxt = "n", cex.lab=1.5, cex.axis=1.3,main=NA,cex.main=1.5)
axis(1, c(1,2), c("Pre-post 1","Pre-post 2"), cex.axis=1.3,cex.lab=1.5)
abline(h = 0,lty=2)
# pre-post 1
points(c(0.9,1.1),c(lab_cont[1,"est"],con_cont[1,"est"]), pch=16, col = c("black","grey"))
segments(c(0.9,1.1),c(lab_cont[1,"lower95"],con_cont[1,"lower95"]),
         c(0.9,1.1),c(lab_cont[1,"upper95"],con_cont[1,"upper95"]),
         col = c("black","grey"), lwd = 1.5)
segments(c(0.9,1.1),c(lab_cont[1,"lower90"],con_cont[1,"lower90"]),
         c(0.9,1.1),c(lab_cont[1,"upper90"],con_cont[1,"upper90"]),
         col = c("black","grey"), lwd = 3)
# pre-post 2
points(c(1.9,2.1),c(lab_cont[2,"est"],con_cont[2,"est"]), pch=16, col = c("black","grey"))
segments(c(1.9,2.1),c(lab_cont[2,"lower95"],con_cont[2,"lower95"]),
         c(1.9,2.1),c(lab_cont[2,"upper95"],con_cont[2,"upper95"]),
         col = c("black","grey"), lwd = 1.5)
segments(c(1.9,2.1),c(lab_cont[2,"lower90"],con_cont[2,"lower90"]),
         c(1.9,2.1),c(lab_cont[2,"upper90"],con_cont[2,"upper90"]),
         col = c("black","grey"), lwd = 3)
legend("topright",legend=c("Labour","Conservative"),lty=c(1,1),col=c("black","grey"),bty="n",cex=1.3,lwd=2,pch=16)
dev.off()

## H2

h2lab_prepost1 <- lm(likeL_post ~ mr * mftcare + likeL_pre, data=dat_lab)
h2lab_prepost2 <- lm(likeLdiff ~ mr * mftcare, data=dat_lab)

h2con_prepost1 <- lm(likeC_post ~ mr * mftfair + likeC_pre, data=dat_con)
h2con_prepost2 <- lm(likeCdiff ~ mr * mftfair, data=dat_con)

labMod_prepost <- interplot(h2lab_prepost1,"mr","mftcare",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Care") +
  ggtitle("Labour: pre-post 1") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

conMod_prepost <- interplot(h2con_prepost1,"mr","mftfair",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Fairness") +
  ggtitle("Conservative: pre-post 1") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

labMod_diff <- interplot(h2lab_prepost2,"mr","mftcare",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Care") +
  ggtitle("Labour: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

conMod_diff <- interplot(h2con_prepost2,"mr","mftfair",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Fairness") +
  ggtitle("Conservative: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

pdf(file="plot_h2_onecontrol.pdf",width=10,height=8)
annotate_figure(ggarrange(labMod_prepost,labMod_diff,conMod_prepost,conMod_diff,
                          ncol=2,nrow=2),
                left=text_grob("Effect of moral rhetoric",size=14,rot=90))
dev.off()

## H3

h3lab_prepost2 <- lm(likeLdiff ~ mr * dislikeL_pre, data=dat_lab)

h3con_prepost2 <- lm(likeCdiff ~ mr * dislikeC_pre, data=dat_con)

labMod_diff <- interplot(h3lab_prepost2,"mr","dislikeL_pre",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Labour Party") +
  ggtitle("Labour: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=16),
        axis.text=element_text(size=14),
        plot.title=element_text(size=16))

conMod_diff <- interplot(h3con_prepost2,"mr","dislikeC_pre",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Conservative Party") +
  ggtitle("Conservative: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=16),
        axis.text=element_text(size=14),
        plot.title=element_text(size=16))

pdf(file="plot_h3_onecontrol.pdf",width=10,height=6)
annotate_figure(ggarrange(labMod_diff,conMod_diff,ncol=2,nrow=1),
                left=text_grob("Effect of moral rhetoric",size=16,rot=90))
dev.off()

######################
### Figures OA4.5-4.7
#######################

## H1

lab_mrcontrol_prepost1 <- lm(likeL_post ~ mrcontrol + likeL_pre, data=dat_lab_sub_nolean)
lab_mrcontrol_prepost2 <- lm(likeLdiff ~ mrcontrol, data=dat_lab_sub_nolean)

lab_mrpr_prepost1 <- lm(likeL_post ~ mrpr + likeL_pre, data=dat_lab_sub_nolean)
lab_mrpr_prepost2 <- lm(likeLdiff ~ mrpr, data=dat_lab_sub_nolean)

con_mrcontrol_prepost1 <-lm(likeC_post ~ mrcontrol + likeC_pre, data=dat_con_sub_nolean)
con_mrcontrol_prepost2 <-lm(likeCdiff ~ mrcontrol, data=dat_con_sub_nolean)

con_mrpr_prepost1 <-lm(likeC_post ~ mrpr + likeC_pre, data=dat_con_sub_nolean)
con_mrpr_prepost2 <-lm(likeCdiff ~ mrpr, data=dat_con_sub_nolean)

labLikeMod_prepost_vcov <- vcovHC(lab_mrcontrol_prepost1, type="HC1")
labLikeMod_prepost_betas <- rmvnorm(n=100000,mean=lab_mrcontrol_prepost1$coefficients,sigma=labLikeMod_prepost_vcov)
labLikeMod_prepost_betas <- labLikeMod_prepost_betas[,c("mrcontrol")]
labLikeMod_prepost_data <- data.frame(dim="Pre-post 1",mrcontrol=1)
labLikeMod_prepost_data$lower95 <- labLikeMod_prepost_data$upper95 <- labLikeMod_prepost_data$lower90 <- labLikeMod_prepost_data$upper90 <- labLikeMod_prepost_data$est <- NA
for(i in 1:nrow(labLikeMod_prepost_data)){
  labLikeMod_prepost_dist <- labLikeMod_prepost_data[i,"mrcontrol"] * labLikeMod_prepost_betas
  labLikeMod_prepost_data[i,"lower95"] <- quantile(labLikeMod_prepost_dist,0.025)
  labLikeMod_prepost_data[i,"lower90"] <- quantile(labLikeMod_prepost_dist,0.05)
  labLikeMod_prepost_data[i,"est"] <- quantile(labLikeMod_prepost_dist,0.5)
  labLikeMod_prepost_data[i,"upper90"] <- quantile(labLikeMod_prepost_dist,0.95)
  labLikeMod_prepost_data[i,"upper95"] <- quantile(labLikeMod_prepost_dist,0.975)
}

labLikeMod_diff_vcov <- vcovHC(lab_mrcontrol_prepost2, type="HC1")
labLikeMod_diff_betas <- rmvnorm(n=100000,mean=lab_mrcontrol_prepost2$coefficients,sigma=labLikeMod_diff_vcov)
labLikeMod_diff_betas <- labLikeMod_diff_betas[,c("mrcontrol")]
labLikeMod_diff_data <- data.frame(dim="Pre-post 2",mrcontrol=1)
labLikeMod_diff_data$lower95 <- labLikeMod_diff_data$upper95 <- labLikeMod_diff_data$lower90 <- labLikeMod_diff_data$upper90 <- labLikeMod_diff_data$est <- NA
for(i in 1:nrow(labLikeMod_diff_data)){
  labLikeMod_diff_dist <- labLikeMod_diff_data[i,"mrcontrol"] * labLikeMod_diff_betas
  labLikeMod_diff_data[i,"lower95"] <- quantile(labLikeMod_diff_dist,0.025)
  labLikeMod_diff_data[i,"lower90"] <- quantile(labLikeMod_diff_dist,0.05)
  labLikeMod_diff_data[i,"est"] <- quantile(labLikeMod_diff_dist,0.5)
  labLikeMod_diff_data[i,"upper90"] <- quantile(labLikeMod_diff_dist,0.95)
  labLikeMod_diff_data[i,"upper95"] <- quantile(labLikeMod_diff_dist,0.975)
}

labLikeModpr_prepost_vcov <- vcovHC(lab_mrpr_prepost1, type="HC1")
labLikeModpr_prepost_betas <- rmvnorm(n=100000,mean=lab_mrpr_prepost1$coefficients,sigma=labLikeModpr_prepost_vcov)
labLikeModpr_prepost_betas <- labLikeModpr_prepost_betas[,c("mrpr")]
labLikeModpr_prepost_data <- data.frame(dim="Pre-post 1",mrpr=1)
labLikeModpr_prepost_data$lower95 <- labLikeModpr_prepost_data$upper95 <- labLikeModpr_prepost_data$lower90 <- labLikeModpr_prepost_data$upper90 <- labLikeModpr_prepost_data$est <- NA
for(i in 1:nrow(labLikeModpr_prepost_data)){
  labLikeModpr_prepost_dist <- labLikeModpr_prepost_data[i,"mrpr"] * labLikeModpr_prepost_betas
  labLikeModpr_prepost_data[i,"lower95"] <- quantile(labLikeModpr_prepost_dist,0.025)
  labLikeModpr_prepost_data[i,"lower90"] <- quantile(labLikeModpr_prepost_dist,0.05)
  labLikeModpr_prepost_data[i,"est"] <- quantile(labLikeModpr_prepost_dist,0.5)
  labLikeModpr_prepost_data[i,"upper90"] <- quantile(labLikeModpr_prepost_dist,0.95)
  labLikeModpr_prepost_data[i,"upper95"] <- quantile(labLikeModpr_prepost_dist,0.975)
}

labLikeModpr_diff_vcov <- vcovHC(lab_mrpr_prepost2, type="HC1")
labLikeModpr_diff_betas <- rmvnorm(n=100000,mean=lab_mrpr_prepost2$coefficients,sigma=labLikeModpr_diff_vcov)
labLikeModpr_diff_betas <- labLikeModpr_diff_betas[,c("mrpr")]
labLikeModpr_diff_data <- data.frame(dim="Pre-post 2",mrpr=1)
labLikeModpr_diff_data$lower95 <- labLikeModpr_diff_data$upper95 <- labLikeModpr_diff_data$lower90 <- labLikeModpr_diff_data$upper90 <- labLikeModpr_diff_data$est <- NA
for(i in 1:nrow(labLikeModpr_diff_data)){
  labLikeModpr_diff_dist <- labLikeModpr_diff_data[i,"mrpr"] * labLikeModpr_diff_betas
  labLikeModpr_diff_data[i,"lower95"] <- quantile(labLikeModpr_diff_dist,0.025)
  labLikeModpr_diff_data[i,"lower90"] <- quantile(labLikeModpr_diff_dist,0.05)
  labLikeModpr_diff_data[i,"est"] <- quantile(labLikeModpr_diff_dist,0.5)
  labLikeModpr_diff_data[i,"upper90"] <- quantile(labLikeModpr_diff_dist,0.95)
  labLikeModpr_diff_data[i,"upper95"] <- quantile(labLikeModpr_diff_dist,0.975)
}

conLikeMod_prepost_vcov <- vcovHC(con_mrcontrol_prepost1, type="HC1")
conLikeMod_prepost_betas <- rmvnorm(n=100000,mean=con_mrcontrol_prepost1$coefficients,sigma=conLikeMod_prepost_vcov)
conLikeMod_prepost_betas <- conLikeMod_prepost_betas[,c("mrcontrol")]
conLikeMod_prepost_data <- data.frame(dim="Pre-post 1",mrcontrol=1)
conLikeMod_prepost_data$lower95 <- conLikeMod_prepost_data$upper95 <- conLikeMod_prepost_data$lower90 <- conLikeMod_prepost_data$upper90 <- conLikeMod_prepost_data$est <- NA
for(i in 1:nrow(conLikeMod_prepost_data)){
  conLikeMod_prepost_dist <- conLikeMod_prepost_data[i,"mrcontrol"] * conLikeMod_prepost_betas
  conLikeMod_prepost_data[i,"lower95"] <- quantile(conLikeMod_prepost_dist,0.025)
  conLikeMod_prepost_data[i,"lower90"] <- quantile(conLikeMod_prepost_dist,0.05)
  conLikeMod_prepost_data[i,"est"] <- quantile(conLikeMod_prepost_dist,0.5)
  conLikeMod_prepost_data[i,"upper90"] <- quantile(conLikeMod_prepost_dist,0.95)
  conLikeMod_prepost_data[i,"upper95"] <- quantile(conLikeMod_prepost_dist,0.975)
}

conLikeMod_diff_vcov <- vcovHC(con_mrcontrol_prepost2, type="HC1")
conLikeMod_diff_betas <- rmvnorm(n=100000,mean=con_mrcontrol_prepost2$coefficients,sigma=conLikeMod_diff_vcov)
conLikeMod_diff_betas <- conLikeMod_diff_betas[,c("mrcontrol")]
conLikeMod_diff_data <- data.frame(dim="Pre-post 2",mrcontrol=1)
conLikeMod_diff_data$lower95 <- conLikeMod_diff_data$upper95 <- conLikeMod_diff_data$lower90 <- conLikeMod_diff_data$upper90 <- conLikeMod_diff_data$est <- NA
for(i in 1:nrow(conLikeMod_diff_data)){
  conLikeMod_diff_dist <- conLikeMod_diff_data[i,"mrcontrol"] * conLikeMod_diff_betas
  conLikeMod_diff_data[i,"lower95"] <- quantile(conLikeMod_diff_dist,0.025)
  conLikeMod_diff_data[i,"lower90"] <- quantile(conLikeMod_diff_dist,0.05)
  conLikeMod_diff_data[i,"est"] <- quantile(conLikeMod_diff_dist,0.5)
  conLikeMod_diff_data[i,"upper90"] <- quantile(conLikeMod_diff_dist,0.95)
  conLikeMod_diff_data[i,"upper95"] <- quantile(conLikeMod_diff_dist,0.975)
}

conLikeModpr_prepost_vcov <- vcovHC(con_mrpr_prepost1, type="HC1")
conLikeModpr_prepost_betas <- rmvnorm(n=100000,mean=con_mrpr_prepost1$coefficients,sigma=conLikeModpr_prepost_vcov)
conLikeModpr_prepost_betas <- conLikeModpr_prepost_betas[,c("mrpr")]
conLikeModpr_prepost_data <- data.frame(dim="Pre-post 1",mrpr=1)
conLikeModpr_prepost_data$lower95 <- conLikeModpr_prepost_data$upper95 <- conLikeModpr_prepost_data$lower90 <- conLikeModpr_prepost_data$upper90 <- conLikeModpr_prepost_data$est <- NA
for(i in 1:nrow(conLikeModpr_prepost_data)){
  conLikeModpr_prepost_dist <- conLikeModpr_prepost_data[i,"mrpr"] * conLikeModpr_prepost_betas
  conLikeModpr_prepost_data[i,"lower95"] <- quantile(conLikeModpr_prepost_dist,0.025)
  conLikeModpr_prepost_data[i,"lower90"] <- quantile(conLikeModpr_prepost_dist,0.05)
  conLikeModpr_prepost_data[i,"est"] <- quantile(conLikeModpr_prepost_dist,0.5)
  conLikeModpr_prepost_data[i,"upper90"] <- quantile(conLikeModpr_prepost_dist,0.95)
  conLikeModpr_prepost_data[i,"upper95"] <- quantile(conLikeModpr_prepost_dist,0.975)
}

conLikeModpr_diff_vcov <- vcovHC(con_mrpr_prepost2, type="HC1")
conLikeModpr_diff_betas <- rmvnorm(n=100000,mean=con_mrpr_prepost2$coefficients,sigma=conLikeModpr_diff_vcov)
conLikeModpr_diff_betas <- conLikeModpr_diff_betas[,c("mrpr")]
conLikeModpr_diff_data <- data.frame(dim="Pre-post 2",mrpr=1)
conLikeModpr_diff_data$lower95 <- conLikeModpr_diff_data$upper95 <- conLikeModpr_diff_data$lower90 <- conLikeModpr_diff_data$upper90 <- conLikeModpr_diff_data$est <- NA
for(i in 1:nrow(conLikeModpr_diff_data)){
  conLikeModpr_diff_dist <- conLikeModpr_diff_data[i,"mrpr"] * conLikeModpr_diff_betas
  conLikeModpr_diff_data[i,"lower95"] <- quantile(conLikeModpr_diff_dist,0.025)
  conLikeModpr_diff_data[i,"lower90"] <- quantile(conLikeModpr_diff_dist,0.05)
  conLikeModpr_diff_data[i,"est"] <- quantile(conLikeModpr_diff_dist,0.5)
  conLikeModpr_diff_data[i,"upper90"] <- quantile(conLikeModpr_diff_dist,0.95)
  conLikeModpr_diff_data[i,"upper95"] <- quantile(conLikeModpr_diff_dist,0.975)
}

lab_cont <- rbind(labLikeMod_prepost_data,labLikeMod_diff_data)
lab_pr <- rbind(labLikeModpr_prepost_data,labLikeModpr_diff_data)

con_cont <- rbind(conLikeMod_prepost_data,conLikeMod_diff_data)
con_pr <- rbind(conLikeModpr_prepost_data,conLikeModpr_diff_data)

pdf("plot_h1lab_noleaners.pdf")
plot(NA,xlim = c(0.5,2.5),ylim = c(-0.4, 0.8), ylab = "Effect of moral rhetoric", xlab = "", xaxt = "n", cex.lab=1.5, cex.axis=1.3,main="Labour",cex.main=1.5)
axis(1, c(1,2), c("Pre-post 1","Pre-post 2"), cex.axis=1.3,cex.lab=1.5)
abline(h = 0,lty=2)
# pre-post 1
points(c(0.9,1.1),c(lab_cont[1,"est"],lab_pr[1,"est"]), pch=16, col = c("black","grey"))
segments(c(0.9,1.1),c(lab_cont[1,"lower95"],lab_pr[1,"lower95"]),
         c(0.9,1.1),c(lab_cont[1,"upper95"],lab_pr[1,"upper95"]),
         col = c("black","grey"), lwd = 1.5)
segments(c(0.9,1.1),c(lab_cont[1,"lower90"],lab_pr[1,"lower90"]),
         c(0.9,1.1),c(lab_cont[1,"upper90"],lab_pr[1,"upper90"]),
         col = c("black","grey"), lwd = 3)
# pre-post 2
points(c(1.9,2.1),c(lab_cont[2,"est"],lab_pr[2,"est"]), pch=16, col = c("black","grey"))
segments(c(1.9,2.1),c(lab_cont[2,"lower95"],lab_pr[2,"lower95"]),
         c(1.9,2.1),c(lab_cont[2,"upper95"],lab_pr[2,"upper95"]),
         col = c("black","grey"), lwd = 1.5)
segments(c(1.9,2.1),c(lab_cont[2,"lower90"],lab_pr[2,"lower90"]),
         c(1.9,2.1),c(lab_cont[2,"upper90"],lab_pr[2,"upper90"]),
         col = c("black","grey"), lwd = 3)
legend("topright",legend=c("moral vs. control","moral vs. pragmatic"),lty=c(1,1),col=c("black","grey"),bty="n",cex=1.3,lwd=2,pch=16)
dev.off()

pdf("plot_h1con_noleaners.pdf")
plot(NA,xlim = c(0.5,2.5),ylim = c(-0.4, 0.8), ylab = "Effect of moral rhetoric", xlab = "", xaxt = "n", cex.lab=1.5, cex.axis=1.3,main="Conservative",cex.main=1.5)
axis(1, c(1,2), c("Pre-post 1","Pre-post 2"), cex.axis=1.3,cex.lab=1.5)
abline(h = 0,lty=2)
# pre-post 1
points(c(0.9,1.1),c(con_cont[1,"est"],con_pr[1,"est"]), pch=16, col = c("black","grey"))
segments(c(0.9,1.1),c(con_cont[1,"lower95"],con_pr[1,"lower95"]),
         c(0.9,1.1),c(con_cont[1,"upper95"],con_pr[1,"upper95"]),
         col = c("black","grey"), lwd = 1.5)
segments(c(0.9,1.1),c(con_cont[1,"lower90"],con_pr[1,"lower90"]),
         c(0.9,1.1),c(con_cont[1,"upper90"],con_pr[1,"upper90"]),
         col = c("black","grey"), lwd = 3)
# pre-post 2
points(c(1.9,2.1),c(con_cont[2,"est"],con_pr[2,"est"]), pch=16, col = c("black","grey"))
segments(c(1.9,2.1),c(con_cont[2,"lower95"],con_pr[2,"lower95"]),
         c(1.9,2.1),c(con_cont[2,"upper95"],con_pr[2,"upper95"]),
         col = c("black","grey"), lwd = 1.5)
segments(c(1.9,2.1),c(con_cont[2,"lower90"],con_pr[2,"lower90"]),
         c(1.9,2.1),c(con_cont[2,"upper90"],con_pr[2,"upper90"]),
         col = c("black","grey"), lwd = 3)
legend("topright",legend=c("moral vs. control","moral vs. pragmatic"),lty=c(1,1),col=c("black","grey"),bty="n",cex=1.3,lwd=2,pch=16)
dev.off()

## H2

lab_mrcontrol_prepost1 <- lm(likeL_post ~ mrcontrol*mftcare + likeL_pre, data=dat_lab_sub_nolean)
lab_mrcontrol_prepost2 <- lm(likeLdiff ~ mrcontrol*mftcare, data=dat_lab_sub_nolean)

lab_mrpr_prepost1 <- lm(likeL_post ~ mrpr*mftcare + likeL_pre, data=dat_lab_sub_nolean)
lab_mrpr_prepost2 <- lm(likeLdiff ~ mrpr*mftcare, data=dat_lab_sub_nolean)

con_mrcontrol_prepost1 <- lm(likeC_post ~ mrcontrol*mftfair + likeC_pre, data=dat_con_sub_nolean)
con_mrcontrol_prepost2 <- lm(likeCdiff ~ mrcontrol*mftfair, data=dat_con_sub_nolean)

con_mrpr_prepost1 <-lm(likeC_post ~ mrpr*mftfair + likeC_pre, data=dat_con_sub_nolean)
con_mrpr_prepost2 <- lm(likeCdiff ~ mrpr*mftfair, data=dat_con_sub_nolean)

labMod_prepost <- interplot(lab_mrcontrol_prepost1,"mrcontrol","mftcare",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Care") +
  ggtitle("Moral vs. control: pre-post 1") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

conMod_prepost <- interplot(con_mrcontrol_prepost1,"mrcontrol","mftfair",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Fairness") +
  ggtitle("Moral vs. control: pre-post 1") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

labModPr_prepost <- interplot(lab_mrpr_prepost1,"mrpr","mftcare",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Care") +
  ggtitle("Moral vs. pragmatic: pre-post 1") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

conModPr_prepost <- interplot(con_mrpr_prepost1,"mrpr","mftfair",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Fairness") +
  ggtitle("Moral vs. pragmatic: pre-post 1") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

labMod_diff <- interplot(lab_mrcontrol_prepost2,"mrcontrol","mftcare",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Care") +
  ggtitle("Moral vs. control: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

conMod_diff <- interplot(con_mrcontrol_prepost2,"mrcontrol","mftfair",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Fairness") +
  ggtitle("Moral vs. control: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

labModPr_diff <- interplot(lab_mrpr_prepost2,"mrpr","mftcare",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Care") +
  ggtitle("Moral vs. pragmatic: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

conModPr_diff <- interplot(con_mrpr_prepost2,"mrpr","mftfair",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Fairness") +
  ggtitle("Moral vs. pragmatic: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

pdf(file="plot_h2lab_noleaners.pdf",width=10,height=8)
annotate_figure(ggarrange(labMod_prepost,labMod_diff,labModPr_prepost,labModPr_diff,
                          ncol=2,nrow=2),
                top=text_grob("Labour Party Experiment\n",size=16,face="bold"),
                left=text_grob("Effect of moral rhetoric",size=16,rot=90))
dev.off()

pdf(file="plot_h2con_noleaners.pdf",width=10,height=8)
annotate_figure(ggarrange(conMod_prepost,conMod_diff,conModPr_prepost,conModPr_diff,
                          ncol=2,nrow=2),
                top=text_grob("Conservative Party Experiment\n",size=16,face="bold"),
                left=text_grob("Effect of moral rhetoric",size=16,rot=90))
dev.off()

## H3

lab_mrcontrol_prepost2 <- lm(likeLdiff ~ mrcontrol * dislikeL_pre, data=dat_lab_sub_nolean)
lab_mrpr_prepost2 <-lm(likeLdiff ~ mrpr * dislikeL_pre, data=dat_lab_sub_nolean)

con_mrcontrol_prepost2 <- lm(likeCdiff ~ mrcontrol * dislikeC_pre, data=dat_con_sub_nolean)
con_mrpr_prepost2 <- lm(likeCdiff ~ mrpr * dislikeC_pre, data=dat_con_sub_nolean)

labMod_diff <- interplot(lab_mrcontrol_prepost2,"mrcontrol","dislikeL_pre",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Labour Party") +
  ggtitle("Moral vs. control: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=16),
        axis.text=element_text(size=14),
        plot.title=element_text(size=16))

conMod_diff <- interplot(con_mrcontrol_prepost2,"mrcontrol","dislikeC_pre",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Conservative Party") +
  ggtitle("Moral vs. control: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=16),
        axis.text=element_text(size=14),
        plot.title=element_text(size=16))

labModPr_diff <- interplot(lab_mrpr_prepost2,"mrpr","dislikeL_pre",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Labour Party") +
  ggtitle("Moral vs. pragmatic: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=16),
        axis.text=element_text(size=14),
        plot.title=element_text(size=16))

conModPr_diff <- interplot(con_mrpr_prepost2,"mrpr","dislikeC_pre",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Conservative Party") +
  ggtitle("Moral vs. pragmatic: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=16),
        axis.text=element_text(size=14),
        plot.title=element_text(size=16))

pdf(file="plot_h3lab_noleaners.pdf",width=10,height=6)
annotate_figure(ggarrange(labMod_diff,labModPr_diff,ncol=2,nrow=1),
                top=text_grob("Labour Party Experiment\n",size=14,face="bold"),
                left=text_grob("Effect of moral rhetoric",size=16,rot=90))
dev.off()

pdf(file="plot_h3con_noleaners.pdf",width=10,height=6)
annotate_figure(ggarrange(conMod_diff,conModPr_diff,ncol=2,nrow=1),
                top=text_grob("Conservative Party Experiment\n",size=14,face="bold"),
                left=text_grob("Effect of moral rhetoric",size=16,rot=90))
dev.off()

############################
#### Figures OA4.8-4.10
############################

## H1

labLikeMod_prepost <- lm(likeL_post ~ mrcontrol + likeL_pre, data=subset(dat_lab,mft1_attention==1&mft2_attention==1))
labLikeMod_diff <- lm(likeLdiff ~ mrcontrol, data=subset(dat_lab,mft1_attention==1&mft2_attention==1))

labLikeModpr_prepost <- lm(likeL_post ~ mrpr + likeL_pre, data=subset(dat_lab,mft1_attention==1&mft2_attention==1))
labLikeModpr_diff <- lm(likeLdiff ~ mrpr, data=subset(dat_lab,mft1_attention==1&mft2_attention==1))

conLikeMod_prepost <- lm(likeC_post ~ mrcontrol + likeC_pre, data=subset(dat_con,mft1_attention==1&mft2_attention==1))
conLikeMod_diff <- lm(likeCdiff ~ mrcontrol, data=subset(dat_con,mft1_attention==1&mft2_attention==1))

conLikeModpr_prepost <- lm(likeC_post ~ mrpr + likeC_pre, data=subset(dat_con,mft1_attention==1&mft2_attention==1))
conLikeModpr_diff <- lm(likeCdiff ~ mrpr, data=subset(dat_con,mft1_attention==1&mft2_attention==1))

labLikeMod_prepost_vcov <- vcovHC(labLikeMod_prepost, type="HC1")
labLikeMod_prepost_betas <- rmvnorm(n=100000,mean=labLikeMod_prepost$coefficients,sigma=labLikeMod_prepost_vcov)
labLikeMod_prepost_betas <- labLikeMod_prepost_betas[,c("mrcontrol")]
labLikeMod_prepost_data <- data.frame(dim="Pre-post 1",mrcontrol=1)
labLikeMod_prepost_data$lower95 <- labLikeMod_prepost_data$upper95 <- labLikeMod_prepost_data$lower90 <- labLikeMod_prepost_data$upper90 <- labLikeMod_prepost_data$est <- NA
for(i in 1:nrow(labLikeMod_prepost_data)){
  labLikeMod_prepost_dist <- labLikeMod_prepost_data[i,"mrcontrol"] * labLikeMod_prepost_betas
  labLikeMod_prepost_data[i,"lower95"] <- quantile(labLikeMod_prepost_dist,0.025)
  labLikeMod_prepost_data[i,"lower90"] <- quantile(labLikeMod_prepost_dist,0.05)
  labLikeMod_prepost_data[i,"est"] <- quantile(labLikeMod_prepost_dist,0.5)
  labLikeMod_prepost_data[i,"upper90"] <- quantile(labLikeMod_prepost_dist,0.95)
  labLikeMod_prepost_data[i,"upper95"] <- quantile(labLikeMod_prepost_dist,0.975)
}

labLikeMod_diff_vcov <- vcovHC(labLikeMod_diff, type="HC1")
labLikeMod_diff_betas <- rmvnorm(n=100000,mean=labLikeMod_diff$coefficients,sigma=labLikeMod_diff_vcov)
labLikeMod_diff_betas <- labLikeMod_diff_betas[,c("mrcontrol")]
labLikeMod_diff_data <- data.frame(dim="Pre-post 2",mrcontrol=1)
labLikeMod_diff_data$lower95 <- labLikeMod_diff_data$upper95 <- labLikeMod_diff_data$lower90 <- labLikeMod_diff_data$upper90 <- labLikeMod_diff_data$est <- NA
for(i in 1:nrow(labLikeMod_diff_data)){
  labLikeMod_diff_dist <- labLikeMod_diff_data[i,"mrcontrol"] * labLikeMod_diff_betas
  labLikeMod_diff_data[i,"lower95"] <- quantile(labLikeMod_diff_dist,0.025)
  labLikeMod_diff_data[i,"lower90"] <- quantile(labLikeMod_diff_dist,0.05)
  labLikeMod_diff_data[i,"est"] <- quantile(labLikeMod_diff_dist,0.5)
  labLikeMod_diff_data[i,"upper90"] <- quantile(labLikeMod_diff_dist,0.95)
  labLikeMod_diff_data[i,"upper95"] <- quantile(labLikeMod_diff_dist,0.975)
}

labLikeModpr_prepost_vcov <- vcovHC(labLikeModpr_prepost, type="HC1")
labLikeModpr_prepost_betas <- rmvnorm(n=100000,mean=labLikeModpr_prepost$coefficients,sigma=labLikeModpr_prepost_vcov)
labLikeModpr_prepost_betas <- labLikeModpr_prepost_betas[,c("mrpr")]
labLikeModpr_prepost_data <- data.frame(dim="Pre-post 1",mrpr=1)
labLikeModpr_prepost_data$lower95 <- labLikeModpr_prepost_data$upper95 <- labLikeModpr_prepost_data$lower90 <- labLikeModpr_prepost_data$upper90 <- labLikeModpr_prepost_data$est <- NA
for(i in 1:nrow(labLikeModpr_prepost_data)){
  labLikeModpr_prepost_dist <- labLikeModpr_prepost_data[i,"mrpr"] * labLikeModpr_prepost_betas
  labLikeModpr_prepost_data[i,"lower95"] <- quantile(labLikeModpr_prepost_dist,0.025)
  labLikeModpr_prepost_data[i,"lower90"] <- quantile(labLikeModpr_prepost_dist,0.05)
  labLikeModpr_prepost_data[i,"est"] <- quantile(labLikeModpr_prepost_dist,0.5)
  labLikeModpr_prepost_data[i,"upper90"] <- quantile(labLikeModpr_prepost_dist,0.95)
  labLikeModpr_prepost_data[i,"upper95"] <- quantile(labLikeModpr_prepost_dist,0.975)
}

labLikeModpr_diff_vcov <- vcovHC(labLikeModpr_diff, type="HC1")
labLikeModpr_diff_betas <- rmvnorm(n=100000,mean=labLikeModpr_diff$coefficients,sigma=labLikeModpr_diff_vcov)
labLikeModpr_diff_betas <- labLikeModpr_diff_betas[,c("mrpr")]
labLikeModpr_diff_data <- data.frame(dim="Pre-post 2",mrpr=1)
labLikeModpr_diff_data$lower95 <- labLikeModpr_diff_data$upper95 <- labLikeModpr_diff_data$lower90 <- labLikeModpr_diff_data$upper90 <- labLikeModpr_diff_data$est <- NA
for(i in 1:nrow(labLikeModpr_diff_data)){
  labLikeModpr_diff_dist <- labLikeModpr_diff_data[i,"mrpr"] * labLikeModpr_diff_betas
  labLikeModpr_diff_data[i,"lower95"] <- quantile(labLikeModpr_diff_dist,0.025)
  labLikeModpr_diff_data[i,"lower90"] <- quantile(labLikeModpr_diff_dist,0.05)
  labLikeModpr_diff_data[i,"est"] <- quantile(labLikeModpr_diff_dist,0.5)
  labLikeModpr_diff_data[i,"upper90"] <- quantile(labLikeModpr_diff_dist,0.95)
  labLikeModpr_diff_data[i,"upper95"] <- quantile(labLikeModpr_diff_dist,0.975)
}

conLikeMod_prepost_vcov <- vcovHC(conLikeMod_prepost, type="HC1")
conLikeMod_prepost_betas <- rmvnorm(n=100000,mean=conLikeMod_prepost$coefficients,sigma=conLikeMod_prepost_vcov)
conLikeMod_prepost_betas <- conLikeMod_prepost_betas[,c("mrcontrol")]
conLikeMod_prepost_data <- data.frame(dim="Pre-post 1",mrcontrol=1)
conLikeMod_prepost_data$lower95 <- conLikeMod_prepost_data$upper95 <- conLikeMod_prepost_data$lower90 <- conLikeMod_prepost_data$upper90 <- conLikeMod_prepost_data$est <- NA
for(i in 1:nrow(conLikeMod_prepost_data)){
  conLikeMod_prepost_dist <- conLikeMod_prepost_data[i,"mrcontrol"] * conLikeMod_prepost_betas
  conLikeMod_prepost_data[i,"lower95"] <- quantile(conLikeMod_prepost_dist,0.025)
  conLikeMod_prepost_data[i,"lower90"] <- quantile(conLikeMod_prepost_dist,0.05)
  conLikeMod_prepost_data[i,"est"] <- quantile(conLikeMod_prepost_dist,0.5)
  conLikeMod_prepost_data[i,"upper90"] <- quantile(conLikeMod_prepost_dist,0.95)
  conLikeMod_prepost_data[i,"upper95"] <- quantile(conLikeMod_prepost_dist,0.975)
}

conLikeMod_diff_vcov <- vcovHC(conLikeMod_diff, type="HC1")
conLikeMod_diff_betas <- rmvnorm(n=100000,mean=conLikeMod_diff$coefficients,sigma=conLikeMod_diff_vcov)
conLikeMod_diff_betas <- conLikeMod_diff_betas[,c("mrcontrol")]
conLikeMod_diff_data <- data.frame(dim="Pre-post 2",mrcontrol=1)
conLikeMod_diff_data$lower95 <- conLikeMod_diff_data$upper95 <- conLikeMod_diff_data$lower90 <- conLikeMod_diff_data$upper90 <- conLikeMod_diff_data$est <- NA
for(i in 1:nrow(conLikeMod_diff_data)){
  conLikeMod_diff_dist <- conLikeMod_diff_data[i,"mrcontrol"] * conLikeMod_diff_betas
  conLikeMod_diff_data[i,"lower95"] <- quantile(conLikeMod_diff_dist,0.025)
  conLikeMod_diff_data[i,"lower90"] <- quantile(conLikeMod_diff_dist,0.05)
  conLikeMod_diff_data[i,"est"] <- quantile(conLikeMod_diff_dist,0.5)
  conLikeMod_diff_data[i,"upper90"] <- quantile(conLikeMod_diff_dist,0.95)
  conLikeMod_diff_data[i,"upper95"] <- quantile(conLikeMod_diff_dist,0.975)
}

conLikeModpr_prepost_vcov <- vcovHC(conLikeModpr_prepost, type="HC1")
conLikeModpr_prepost_betas <- rmvnorm(n=100000,mean=conLikeModpr_prepost$coefficients,sigma=conLikeModpr_prepost_vcov)
conLikeModpr_prepost_betas <- conLikeModpr_prepost_betas[,c("mrpr")]
conLikeModpr_prepost_data <- data.frame(dim="Pre-post 1",mrpr=1)
conLikeModpr_prepost_data$lower95 <- conLikeModpr_prepost_data$upper95 <- conLikeModpr_prepost_data$lower90 <- conLikeModpr_prepost_data$upper90 <- conLikeModpr_prepost_data$est <- NA
for(i in 1:nrow(conLikeModpr_prepost_data)){
  conLikeModpr_prepost_dist <- conLikeModpr_prepost_data[i,"mrpr"] * conLikeModpr_prepost_betas
  conLikeModpr_prepost_data[i,"lower95"] <- quantile(conLikeModpr_prepost_dist,0.025)
  conLikeModpr_prepost_data[i,"lower90"] <- quantile(conLikeModpr_prepost_dist,0.05)
  conLikeModpr_prepost_data[i,"est"] <- quantile(conLikeModpr_prepost_dist,0.5)
  conLikeModpr_prepost_data[i,"upper90"] <- quantile(conLikeModpr_prepost_dist,0.95)
  conLikeModpr_prepost_data[i,"upper95"] <- quantile(conLikeModpr_prepost_dist,0.975)
}

conLikeModpr_diff_vcov <- vcovHC(conLikeModpr_diff, type="HC1")
conLikeModpr_diff_betas <- rmvnorm(n=100000,mean=conLikeModpr_diff$coefficients,sigma=conLikeModpr_diff_vcov)
conLikeModpr_diff_betas <- conLikeModpr_diff_betas[,c("mrpr")]
conLikeModpr_diff_data <- data.frame(dim="Pre-post 2",mrpr=1)
conLikeModpr_diff_data$lower95 <- conLikeModpr_diff_data$upper95 <- conLikeModpr_diff_data$lower90 <- conLikeModpr_diff_data$upper90 <- conLikeModpr_diff_data$est <- NA
for(i in 1:nrow(conLikeModpr_diff_data)){
  conLikeModpr_diff_dist <- conLikeModpr_diff_data[i,"mrpr"] * conLikeModpr_diff_betas
  conLikeModpr_diff_data[i,"lower95"] <- quantile(conLikeModpr_diff_dist,0.025)
  conLikeModpr_diff_data[i,"lower90"] <- quantile(conLikeModpr_diff_dist,0.05)
  conLikeModpr_diff_data[i,"est"] <- quantile(conLikeModpr_diff_dist,0.5)
  conLikeModpr_diff_data[i,"upper90"] <- quantile(conLikeModpr_diff_dist,0.95)
  conLikeModpr_diff_data[i,"upper95"] <- quantile(conLikeModpr_diff_dist,0.975)
}

lab_cont <- rbind(labLikeMod_prepost_data,labLikeMod_diff_data)
lab_pr <- rbind(labLikeModpr_prepost_data,labLikeModpr_diff_data)

con_cont <- rbind(conLikeMod_prepost_data,conLikeMod_diff_data)
con_pr <- rbind(conLikeModpr_prepost_data,conLikeModpr_diff_data)

pdf("plot_h1lab_attentive.pdf")
plot(NA,xlim = c(0.5,2.5),ylim = c(-0.5, 0.9), ylab = "Effect of moral rhetoric", xlab = "", xaxt = "n", cex.lab=1.5, cex.axis=1.3,main="Labour",cex.main=1.5)
axis(1, c(1,2), c("Pre-post 1","Pre-post 2"), cex.axis=1.3,cex.lab=1.5)
abline(h = 0,lty=2)
# pre-post 1
points(c(0.9,1.1),c(lab_cont[1,"est"],lab_pr[1,"est"]), pch=16, col = c("black","grey"))
segments(c(0.9,1.1),c(lab_cont[1,"lower95"],lab_pr[1,"lower95"]),
         c(0.9,1.1),c(lab_cont[1,"upper95"],lab_pr[1,"upper95"]),
         col = c("black","grey"), lwd = 1.5)
segments(c(0.9,1.1),c(lab_cont[1,"lower90"],lab_pr[1,"lower90"]),
         c(0.9,1.1),c(lab_cont[1,"upper90"],lab_pr[1,"upper90"]),
         col = c("black","grey"), lwd = 3)
# pre-post 2
points(c(1.9,2.1),c(lab_cont[2,"est"],lab_pr[2,"est"]), pch=16, col = c("black","grey"))
segments(c(1.9,2.1),c(lab_cont[2,"lower95"],lab_pr[2,"lower95"]),
         c(1.9,2.1),c(lab_cont[2,"upper95"],lab_pr[2,"upper95"]),
         col = c("black","grey"), lwd = 1.5)
segments(c(1.9,2.1),c(lab_cont[2,"lower90"],lab_pr[2,"lower90"]),
         c(1.9,2.1),c(lab_cont[2,"upper90"],lab_pr[2,"upper90"]),
         col = c("black","grey"), lwd = 3)
legend("topright",legend=c("moral vs. control","moral vs. pragmatic"),lty=c(1,1),col=c("black","grey"),bty="n",cex=1.3,lwd=2,pch=16)
dev.off()

pdf("plot_h1con_attentive.pdf")
plot(NA,xlim = c(0.5,2.5),ylim = c(-0.5, 0.9), ylab = "Effect of moral rhetoric", xlab = "", xaxt = "n", cex.lab=1.5, cex.axis=1.3,main="Conservative",cex.main=1.5)
axis(1, c(1,2), c("Pre-post 1","Pre-post 2"), cex.axis=1.3,cex.lab=1.5)
abline(h = 0,lty=2)
# pre-post 1
points(c(0.9,1.1),c(con_cont[1,"est"],con_pr[1,"est"]), pch=16, col = c("black","grey"))
segments(c(0.9,1.1),c(con_cont[1,"lower95"],con_pr[1,"lower95"]),
         c(0.9,1.1),c(con_cont[1,"upper95"],con_pr[1,"upper95"]),
         col = c("black","grey"), lwd = 1.5)
segments(c(0.9,1.1),c(con_cont[1,"lower90"],con_pr[1,"lower90"]),
         c(0.9,1.1),c(con_cont[1,"upper90"],con_pr[1,"upper90"]),
         col = c("black","grey"), lwd = 3)
# pre-post 2
points(c(1.9,2.1),c(con_cont[2,"est"],con_pr[2,"est"]), pch=16, col = c("black","grey"))
segments(c(1.9,2.1),c(con_cont[2,"lower95"],con_pr[2,"lower95"]),
         c(1.9,2.1),c(con_cont[2,"upper95"],con_pr[2,"upper95"]),
         col = c("black","grey"), lwd = 1.5)
segments(c(1.9,2.1),c(con_cont[2,"lower90"],con_pr[2,"lower90"]),
         c(1.9,2.1),c(con_cont[2,"upper90"],con_pr[2,"upper90"]),
         col = c("black","grey"), lwd = 3)
legend("topright",legend=c("moral vs. control","moral vs. pragmatic"),lty=c(1,1),col=c("black","grey"),bty="n",cex=1.3,lwd=2,pch=16)
dev.off()

## H2

h2Like_prepost <- lm(likeL_post ~ mrcontrol * mftcare + likeL_pre, data=subset(dat_lab,mft1_attention==1&mft2_attention==1))
h2Like_diff <- lm(likeLdiff ~ mrcontrol * mftcare, data=subset(dat_lab,mft1_attention==1&mft2_attention==1))

h2Likepr_prepost <- lm(likeL_post ~ mrpr * mftcare + likeL_pre, data=subset(dat_lab,mft1_attention==1&mft2_attention==1))
h2Likepr_diff <- lm(likeLdiff ~ mrpr * mftcare, data=subset(dat_lab,mft1_attention==1&mft2_attention==1))

h2Cike_prepost <- lm(likeC_post ~ mrcontrol * mftfair + likeC_pre, data=subset(dat_con,mft1_attention==1&mft2_attention==1))
h2Cike_diff <- lm(likeCdiff ~ mrcontrol * mftfair, data=subset(dat_con,mft1_attention==1&mft2_attention==1))

h2Cikepr_prepost <- lm(likeC_post ~ mrpr * mftfair + likeC_pre, data=subset(dat_con,mft1_attention==1&mft2_attention==1))
h2Cikepr_diff <- lm(likeCdiff ~ mrpr * mftfair, data=subset(dat_con,mft1_attention==1&mft2_attention==1))

labMod_prepost <- interplot(h2Like_prepost,"mrcontrol","mftcare",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Care") +
  ggtitle("Moral vs. control: pre-post 1") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

conMod_prepost <- interplot(h2Cike_prepost,"mrcontrol","mftfair",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Fairness") +
  ggtitle("Moral vs. control: pre-post 1") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

labModPr_prepost <- interplot(h2Likepr_prepost,"mrpr","mftcare",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Care") +
  ggtitle("Moral vs. pragmatic: pre-post 1") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

conModPr_prepost <- interplot(h2Cikepr_prepost,"mrpr","mftfair",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Fairness") +
  ggtitle("Moral vs. pragmatic: pre-post 1") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

labMod_diff <- interplot(h2Like_diff,"mrcontrol","mftcare",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Care") +
  ggtitle("Moral vs. control: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

conMod_diff <- interplot(h2Cike_diff,"mrcontrol","mftfair",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Fairness") +
  ggtitle("Moral vs. control: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

labModPr_diff <- interplot(h2Likepr_diff,"mrpr","mftcare",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Care") +
  ggtitle("Moral vs. pragmatic: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

conModPr_diff <- interplot(h2Cikepr_diff,"mrpr","mftfair",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Fairness") +
  ggtitle("Moral vs. pragmatic: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

pdf(file="plot_h2lab_attentive.pdf",width=10,height=8)
annotate_figure(ggarrange(labMod_prepost,labMod_diff,labModPr_prepost,labModPr_diff,
                          ncol=2,nrow=2),
                top=text_grob("Labour Party Experiment\n",size=16,face="bold"),
                left=text_grob("Effect of moral rhetoric",size=16,rot=90))
dev.off()

pdf(file="plot_h2con_attentive.pdf",width=10,height=8)
annotate_figure(ggarrange(conMod_prepost,conMod_diff,conModPr_prepost,conModPr_diff,
                          ncol=2,nrow=2),
                top=text_grob("Conservative Party Experiment\n",size=16,face="bold"),
                left=text_grob("Effect of moral rhetoric",size=16,rot=90))
dev.off()

## H3

# Labour

h3labLike_diff <- lm(likeLdiff ~ mrcontrol * dislikeL_pre, data=subset(dat_lab,mft1_attention==1&mft2_attention==1))
h3labLikepr_diff <- lm(likeLdiff ~ mrpr * dislikeL_pre, data=subset(dat_lab,mft1_attention==1&mft2_attention==1))

h3conLike_diff <- lm(likeCdiff ~ mrcontrol * dislikeC_pre, data=subset(dat_con,mft1_attention==1&mft2_attention==1))
h3conLikepr_diff <- lm(likeCdiff ~ mrpr * dislikeC_pre, data=subset(dat_con,mft1_attention==1&mft2_attention==1))

labMod_diff <- interplot(h3labLike_diff,"mrcontrol","dislikeL_pre",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Labour Party") +
  ggtitle("Moral vs. control: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=16),
        axis.text=element_text(size=14),
        plot.title=element_text(size=16))

conMod_diff <- interplot(h3conLike_diff,"mrcontrol","dislikeC_pre",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Conservative Party") +
  ggtitle("Moral vs. control: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=16),
        axis.text=element_text(size=14),
        plot.title=element_text(size=16))

labModPr_diff <- interplot(h3labLikepr_diff,"mrpr","dislikeL_pre",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Labour Party") +
  ggtitle("Moral vs. pragmatic: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=16),
        axis.text=element_text(size=14),
        plot.title=element_text(size=16))

conModPr_diff <- interplot(h3conLikepr_diff,"mrpr","dislikeC_pre",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Conservative Party") +
  ggtitle("Moral vs. pragmatic: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=16),
        axis.text=element_text(size=14),
        plot.title=element_text(size=16))

pdf(file="plot_h3lab_attentive.pdf",width=10,height=6)
annotate_figure(ggarrange(labMod_diff,labModPr_diff,ncol=2,nrow=1),
                top=text_grob("Labour Party Experiment\n",size=14,face="bold"),
                left=text_grob("Effect of moral rhetoric",size=16,rot=90))
dev.off()

pdf(file="plot_h3con_attentive.pdf",width=10,height=6)
annotate_figure(ggarrange(conMod_diff,conModPr_diff,ncol=2,nrow=1),
                top=text_grob("Conservative Party Experiment\n",size=14,face="bold"),
                left=text_grob("Effect of moral rhetoric",size=16,rot=90))
dev.off()

##################
### Figure OA4.11
##################

## Labour

h2labLike_prepost <- lm(likeL_post ~ mrcontrol * mftfair + likeL_pre, data=dat_lab)
h2labLike_diff <- lm(likeLdiff ~ mrcontrol * mftfair, data=dat_lab)

h2labLikepr_prepost <- lm(likeL_post ~ mrpr * mftfair + likeL_pre, data=dat_lab)
h2labLikepr_diff <- lm(likeLdiff ~ mrpr * mftfair, data=dat_lab)

labMod_prepost <- interplot(h2labLike_prepost,"mrcontrol","mftfair",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Fairness") +
  ggtitle("Moral vs. control: pre-post 1") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

labModPr_prepost <- interplot(h2labLikepr_prepost,"mrpr","mftfair",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Fairness") +
  ggtitle("Moral vs. pragmatic: pre-post 1") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

labMod_diff <- interplot(h2labLike_diff,"mrcontrol","mftfair",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Fairness") +
  ggtitle("Moral vs. control: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

labModPr_diff <- interplot(h2labLikepr_diff,"mrpr","mftfair",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Fairness") +
  ggtitle("Moral vs. pragmatic: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

pdf(file="plot_h2lab_fair.pdf",width=10,height=8)
annotate_figure(ggarrange(labMod_prepost,labMod_diff,labModPr_prepost,labModPr_diff,
                          ncol=2,nrow=2),
                top=text_grob("Labour Party Experiment\n",size=16,face="bold"),
                left=text_grob("Effect of moral rhetoric",size=16,rot=90))
dev.off()

## Conservative

h2conLike_prepost <- lm(likeC_post ~ mrcontrol * mftcare + likeC_pre, data=dat_con)
h2conLike_diff <- lm(likeCdiff ~ mrcontrol * mftcare, data=dat_con)

h2conLikepr_prepost <- lm(likeC_post ~ mrpr * mftcare + likeC_pre, data=dat_con)
h2conLikepr_diff <- lm(likeCdiff ~ mrpr * mftcare, data=dat_con)

conMod_prepost <- interplot(h2conLike_prepost,"mrcontrol","mftcare",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Care") +
  ggtitle("Moral vs. control: pre-post 1") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

conModPr_prepost <- interplot(h2conLikepr_prepost,"mrpr","mftcare",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Care") +
  ggtitle("Moral vs. pragmatic: pre-post 1") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

conMod_diff <- interplot(h2conLike_diff,"mrcontrol","mftcare",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Care") +
  ggtitle("Moral vs. control: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

conModPr_diff <- interplot(h2conLikepr_diff,"mrpr","mftcare",hist=T,sims = 100000) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Care") +
  ggtitle("Moral vs. pragmatic: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=14),
        axis.text=element_text(size=14),
        plot.title=element_text(size=14))

pdf(file="plot_h2con_care.pdf",width=10,height=8)
annotate_figure(ggarrange(conMod_prepost,conMod_diff,conModPr_prepost,conModPr_diff,
                          ncol=2,nrow=2),
                top=text_grob("Conservative Party Experiment\n",size=16,face="bold"),
                left=text_grob("Effect of moral rhetoric",size=16,rot=90))
dev.off()

######################
### OA5
#######################

## H1

labLikeModprcont_prepost <- lm(likeL_post ~ prcontrol + likeL_pre, dat_lab)
labLikeModprcont_diff <- lm(likeLdiff ~ prcontrol, dat_lab)

conLikeModprcont_prepost <- lm(likeC_post ~ prcontrol + likeC_pre, dat_con)
conLikeModprcont_diff <- lm(likeCdiff ~ prcontrol, dat_con)

slopes_prc <- c(coef(summary(labLikeModprcont_prepost))[2,1],coef(summary(conLikeModprcont_prepost))[2,1],
                coef(summary(labLikeModprcont_diff))[2,1],coef(summary(conLikeModprcont_diff))[2,1])
ses_prc <- c(coef(summary(labLikeModprcont_prepost))[2,2],coef(summary(conLikeModprcont_prepost))[2,2],
             coef(summary(labLikeModprcont_diff))[2,2],coef(summary(conLikeModprcont_diff))[2,2])

pdf("plot_h1_prcontrol.pdf")
plot(NA,xlim = c(0,3),ylim = c(-0.5, 1.0), ylab = "Effect of pragmatic rhetoric", xlab = "", xaxt = "n", cex.lab=1.5, cex.axis=1.3,cex.main=1.5)
axis(1, c(0.8,2.2), c("Labour","Conservative"), cex.axis=1.3,cex.lab=1.5)
abline(h = 0,lty=2)
points(c(0.7,0.9),c(slopes_prc[1],slopes_prc[3]), pch=c(16,17), col = c("black","black"), bg = "grey",cex=c(1.5,1.5))
segments(c(0.7,0.9),c(slopes_prc[1] - (1.96 * ses_prc[1]),slopes_prc[3] - (1.96 * ses_prc[3])),
         c(0.7,0.9),c(slopes_prc[1] + (1.96 * ses_prc[1]),slopes_prc[3] + (1.96 * ses_prc[3])),
         col = c("black","black"), lwd = 3, lty=c(1,1))
points(c(2.1,2.3),c(slopes_prc[2],slopes_prc[4]), pch=c(16,17), col = c("black","black"), bg = "black",cex=c(1.5,1.5))
segments(c(2.1,2.3),c(slopes_prc[2] - (1.96 * ses_prc[2]),slopes_prc[4] - (1.96 * ses_prc[4])),
         c(2.1,2.3),c(slopes_prc[2] + (1.96 * ses_prc[2]),slopes_prc[4] + (1.96 * ses_prc[4])),
         col = c("black","black"), lwd = 3, lty=c(1,1))
legend("topright",legend=c("pre-post 1","pre-post 2"),lty=c(1,1,1),col=c("black","black"),bty="n",cex=1.3,lwd=3,pch=c(16,17))
dev.off()

## H3

h3labLikeprcont_diff <- lm(likeLdiff ~ prcontrol * dislikeL_pre, data=dat_lab)
h3conLikeprcont_diff <- lm(likeCdiff ~ prcontrol * dislikeC_pre, data=dat_con)

labModPrcont_diff <- interplot(h3labLikeprcont_diff,"prcontrol","dislikeL_pre",hist=T) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Labour Party") +
  ggtitle("Labour: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=17),
        axis.text=element_text(size=14),
        plot.title=element_text(size=17))

conModPrcont_diff <- interplot(h3conLikeprcont_diff,"prcontrol","dislikeC_pre",hist=T) +
  geom_hline(yintercept = 0, colour = "grey60", linetype = 2) +
  labs(x="Dislike of Conservative Party") +
  ggtitle("Conservative: pre-post 2") +
  theme(axis.title=element_text(size=14),plot.title=element_text(size=14)) +
  theme_bw()  +
  theme(axis.line = element_line(color='black'),
        plot.background = element_blank(),
        panel.grid.minor = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.title=element_text(size=17),
        axis.text=element_text(size=14),
        plot.title=element_text(size=17))

pdf("plot_h3_prcontrol.pdf",width=12)
annotate_figure(ggarrange(labModPrcont_diff,conModPrcont_diff,
                          ncol=2,nrow=1),
                left=text_grob("Effect of pragmatic rhetoric",size=17,rot=90))
dev.off()

######################
### OA6
#######################

# Read follow-up data
lab <- read.csv("Raw_followup.csv")

# Organize moral foundations
lab$mft1care1 <- as.numeric(mapvalues(as.character(lab$mft1_1.), 
                                      c("Not at all relevant (This consideration has nothing to do with my judgements of right and wrong)",
                                        "Not very relevant",
                                        "Slightly relevant",
                                        "Somewhat relevant",
                                        "Very relevant",
                                        "Extremely relevant (This is one of the most important factors when I judge right and wrong)"),
                                      1:6)) 
lab$mft1fair1 <- as.numeric(mapvalues(as.character(lab$mft1_2), 
                                      c("Not at all relevant (This consideration has nothing to do with my judgements of right and wrong)",
                                        "Not very relevant",
                                        "Slightly relevant",
                                        "Somewhat relevant",
                                        "Very relevant",
                                        "Extremely relevant (This is one of the most important factors when I judge right and wrong)"),
                                      1:6)) 
lab$mft1care2 <- as.numeric(mapvalues(as.character(lab$mft1_4), 
                                      c("Not at all relevant (This consideration has nothing to do with my judgements of right and wrong)",
                                        "Not very relevant",
                                        "Slightly relevant",
                                        "Somewhat relevant",
                                        "Very relevant",
                                        "Extremely relevant (This is one of the most important factors when I judge right and wrong)"),
                                      1:6)) 
lab$mft1fair2 <- as.numeric(mapvalues(as.character(lab$mft1_5), 
                                      c("Not at all relevant (This consideration has nothing to do with my judgements of right and wrong)",
                                        "Not very relevant",
                                        "Slightly relevant",
                                        "Somewhat relevant",
                                        "Very relevant",
                                        "Extremely relevant (This is one of the most important factors when I judge right and wrong)"),
                                      1:6)) 

lab$mft2care1 <- as.numeric(mapvalues(as.character(lab$mft2_1), 
                                      c("Strongly disagree","Moderately disagree",
                                        "Slightly disagree","Slightly agree",
                                        "Moderately agree","Strongly agree"),
                                      1:6)) 
lab$mft2fair1 <- as.numeric(mapvalues(as.character(lab$mft2_2), 
                                      c("Strongly disagree","Moderately disagree",
                                        "Slightly disagree","Slightly agree",
                                        "Moderately agree","Strongly agree"),
                                      1:6)) 
lab$mft2care2 <- as.numeric(mapvalues(as.character(lab$mft2_4), 
                                      c("Strongly disagree","Moderately disagree",
                                        "Slightly disagree","Slightly agree",
                                        "Moderately agree","Strongly agree"),
                                      1:6))
lab$mft2fair2 <- as.numeric(mapvalues(as.character(lab$mft2_5), 
                                      c("Strongly disagree","Moderately disagree",
                                        "Slightly disagree","Slightly agree",
                                        "Moderately agree","Strongly agree"),
                                      1:6)) 

# Create moral foundations variables
lab$mftcare <- apply(lab[,c("mft1care1","mft1care2","mft2care1","mft2care2")],1,mean)
lab$mftfair <- apply(lab[,c("mft1fair1","mft1fair2","mft2fair1","mft2fair2")],1,mean)

# Create variables indicating those who paid attention
lab$mft1_attention <- as.numeric(mapvalues(as.character(lab$mft1_3), 
                                           c("Not at all relevant (This consideration has nothing to do with my judgements of right and wrong)",
                                             "Not very relevant",
                                             "Slightly relevant",
                                             "Somewhat relevant",
                                             "Very relevant",
                                             "Extremely relevant (This is one of the most important factors when I judge right and wrong)"),
                                           c(1,1,1,1,0,0)))
lab$mft2_attention <- as.numeric(mapvalues(as.character(lab$mft2_3), 
                                           c("Strongly disagree","Moderately disagree",
                                             "Slightly disagree","Slightly agree",
                                             "Moderately agree","Strongly agree"),
                                           c(0,0,0,1,1,1))) 


# Organize pre-treatment like variable
lab$likeL_pre <- as.numeric(mapvalues(as.character(lab$preDV), 
                                      c("0 Strongly dislike",
                                        "1","2","3","4","5","6","7","8","9",
                                        "10 Strongly like"),
                                      0:10))

# Organize post-treatment like variable
lab$postDV <- lab$control_DV
lab$postDV[which(lab$control_DV==""&lab$pragmatic_DV!="")] <- lab$pragmatic_DV[which(lab$control_DV==""&lab$pragmatic_DV!="")]
lab$postDV[which(lab$control_DV==""&lab$moral_DV!="")] <- lab$moral_DV[which(lab$control_DV==""&lab$moral_DV!="")]
lab$likeL_post <- as.numeric(mapvalues(as.character(lab$postDV), 
                                       c("0 Strongly dislike",
                                         "1","2","3","4","5","6","7","8","9",
                                         "10 Strongly like"),
                                       0:10))

# Create differenced like variable
lab$likeLdiff <- lab$likeL_post - lab$likeL_pre

# Create treatment variables
lab$mrcontrol <- as.numeric(mapvalues(as.character(lab$FL_13_DO), c("Control","Moral","Pragmatic"),c(0,1,NA)))
lab$mrpr <- as.numeric(mapvalues(as.character(lab$FL_13_DO), c("Control","Moral","Pragmatic"),c(NA,1,0)))
lab$prcontrol <- as.numeric(mapvalues(as.character(lab$FL_13_DO), c("Control","Moral","Pragmatic"),c(0,NA,1)))

# Create pre-treatment dislike variable
lab$dislikeL_pre <- mapvalues(lab$likeL_pre,0:10,10:0)

# Subset to those who paid attention
lab <- subset(lab,mft1_attention==1&mft2_attention==1)

## H1

labLikeMod_prepost <- lm(likeL_post ~ mrcontrol + likeL_pre, data=lab)
labLikeMod_diff <- lm(likeLdiff ~ mrcontrol, data=lab)
labLikeModpr_prepost <- lm(likeL_post ~ mrpr + likeL_pre, data=lab)
labLikeModpr_diff <- lm(likeLdiff ~ mrpr, data=lab)

texreg(list(labLikeMod_prepost,labLikeMod_diff,labLikeModpr_prepost,labLikeModpr_diff),stars=c(0.001,0.01,0.05,0.1),symbol="\\dagger")

## H2

h2labLike_prepost <- lm(likeL_post ~ mrcontrol + likeL_pre, data=subset(lab,mftcare>=4.25))
h2labLikepr_prepost <- lm(likeL_post ~ mrpr + likeL_pre, data=subset(lab,mftcare>=4.25))

h2labLike_diff <- lm(likeLdiff ~ mrcontrol, data=subset(lab,mftcare>=4.25))
h2labLikepr_diff <- lm(likeLdiff ~ mrpr, data=subset(lab,mftcare>=4.25))

texreg(list(h2labLike_prepost,h2labLike_diff,h2labLikepr_prepost,h2labLikepr_diff),stars=0.05)

## H3

h3labLike_diff <- lm(likeLdiff ~ mrcontrol, data=subset(lab,dislikeL_pre>=6))
h3labLikepr_diff <- lm(likeLdiff ~ mrpr, data=subset(lab,dislikeL_pre>=6))

h3labLike_diff2 <- lm(likeLdiff ~ mrcontrol, data=subset(lab,dislikeL_pre>=6&dislikeL_pre<10))
h3labLikepr_diff2 <- lm(likeLdiff ~ mrpr, data=subset(lab,dislikeL_pre>=6&dislikeL_pre<10))

texreg(list(h3labLike_diff,h3labLikepr_diff,h3labLike_diff2,h3labLikepr_diff2),stars=0.05)
